{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "%reload_ext Cython\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Content of stdout:\n",
      "_cython_magic_28538f0c89f0609459dd23bcb0e3ecbca75be44c.c\n",
      "  正在创建库 C:\\Users\\shenyc\\.ipython\\cython\\Users\\shenyc\\.ipython\\cython\\_cython_magic_28538f0c89f0609459dd23bcb0e3ecbca75be44c.cp312-win_amd64.lib 和对象 C:\\Users\\shenyc\\.ipython\\cython\\Users\\shenyc\\.ipython\\cython\\_cython_magic_28538f0c89f0609459dd23bcb0e3ecbca75be44c.cp312-win_amd64.exp\n",
      "正在生成代码\n",
      "已完成代码的生成45\n"
     ]
    }
   ],
   "source": [
    "%%cython\n",
    "\n",
    "cdef int a = 0\n",
    "for i in range(10):\n",
    "    a += i\n",
    "\n",
    "print(a)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
